package sh.ds.el.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import sh.ds.el.dao.MenuDao;
import sh.ds.el.dto.MenuQueryDto;
import sh.ds.el.entity.MenuVO;
import sh.ds.el.exception.ServiceException;
import sh.ds.el.service.MenuService;
import sh.ds.el.service.base.impl.ElServiceImpl;

@Service
public class MenuServiceImpl extends ElServiceImpl implements MenuService {

	@Autowired
	private MenuDao menuDao;
	
	@Override
	public List<MenuVO> queryMenusByUserIdAndQueryDto(Long userId,
			MenuQueryDto queryDto) throws ServiceException {
		return menuDao.queryMenusByUserIdAndQueryDto(userId, queryDto);
	}
	
	@Override
	public List<MenuVO> queryFirstMenusForUser(Long userId)
			throws ServiceException {
		MenuQueryDto menuQueryDto = new MenuQueryDto();
		menuQueryDto.setMenuLevel(1L);
		return queryMenusByUserIdAndQueryDto(userId, menuQueryDto);
	}

}
